files_name = './read_file/guest.txt'

prompt = '\nTell me something, and I will repeat it back to you'
prompt += '\nEnter "quit" to end the program '
message = ''

while True:
    message = input(prompt)
    
    if message == 'q':
        print(message)
        break
    else:
        with open(files_name, 'w') as files_object:
            files_object.write(message + '\n')